
//
//  Zone.m
//  HomeWork 05 排序、数组字典的处理
//
//  Created by dllo on 16/7/11.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "Zone.h"

@implementation Zone
// 在实例方法中，self 表示对象
- (instancetype)initWithName:(NSString *)name {
    return [self initWithName:name number:nil];
}
//self 表示类对象本身
+ (instancetype)zoneWithName:(NSString *)name {
    
    return [[self alloc]initWithName:name];
    
}

// 指派初始化
- (instancetype)initWithName:(NSString *)name number:(NSString *)number {
    self = [super init];
    if (self
        ) {
        _name = name;
        _number = number;
    }
    return self;
}
+ (instancetype)zoneWithName:(NSString *)name number:(NSString *)number {
    return [[self alloc]initWithName:name number:number];
}

- (instancetype)initWithTempCity:(TempCity *)tempcity {
    return  [self initWithName:tempcity.cityName number:tempcity.cityNumber];
    
}
+ (instancetype)zoneWtihTempCity:(TempCity *)tempcity {
    return [[self alloc]initWithName:tempcity.cityName number:tempcity.cityNumber];
}


@end
